import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:get/get.dart';

import 'fading_circle.dart';

class LoadingPage extends StatelessWidget {
  final bool loading;
  final Widget child;

  const LoadingPage({super.key, required this.loading, required this.child});

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        loading ? Align(alignment: Alignment.center, child: FadingCircle(
          color: Get.theme.primaryColor,
          size: 120,
        ),) : Container(width: double.infinity, child: child,),
      ],
    );

  }
}
